<?php

namespace app\common\job;

use app\common\library\queue\Job;
use app\common\library\queue\ShouldQueue;
use app\common\logic\OrderLogic;
use app\common\model\Order;

class CancelOrderJob extends Job implements ShouldQueue
{
    public $order;

    public function __construct(Order $order)
    {
        $this->order = $order;
    }

    /**
     * @return void
     * @throws \app\common\library\exception\ApiException
     */
    public function handle()
    {
        (new OrderLogic)->cancelOrder($this->order);
    }
}
